<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
	th:replace="fragments/generic-frame-table::frame(~{fragments/menu::menu(7)}, ~{::th}, ~{::tr},
	 ~{::form}, null, ~{::script})">
<head></head>
<body>
	<th>课程名称</th>
	<th>开课教师编号</th>
	<th>第几周开始</th>
	<th>第几周结束</th>
	<th>星期几上课</th>
	<th>第几节课</th>
	<th>教室名称</th>
	<th>课程类型</th>
	<th>课程状态</th>

	<tr th:each="cinfo : ${list}">
		<th:block th:with="c=${cinfo.course}">
			<td><input type="checkbox" id="check-all" class="flat"></td>
			<td th:text="${c.name}">Web高级编程</td>
			<td th:text="${cinfo.teacher}">张恒锋</td>
			<td th:text="${c.startweek}">10</td>
			<td th:text="${c.endweek}">17</td>
			<td th:text="${c.dayofweek}">1</td>
			<td th:text="${c.lesson}">2</td>
			<td th:text="${c.classroom}">C202</td>
			<td th:text="${c.type==0 ? '非实验课' : '实验课'}">非实验课</td>
			<td th:if="${c.state==0}">还未通过审核</td>
			<td th:if="${c.state==1}">审核通过</td>
			<td th:if="${c.state==2}">审核不通过</td>
			<td th:if="${c.state==3}">已结课</td>
		</th:block>
	</tr>
	<!-- 编辑实验课弹窗 -->
	<form id="modal-form" action="submit-experiment" method="post">

		<div class="form-group">
			<label for="course" class="control-label">课程名称</label> <input
				type="text" name="course" class="form-control" id=course>
		</div>

	</form>


	<!-- 函数事件待完善 -->
	<script type="text/javascript">
		$(function() {
			var $datatable = $('#datatable-checkbox');
			$datatable.dataTable({
				dom : "Blrftip",
				responsive : true,
				'order' : [ [ 1, 'asc' ] ],
				'columnDefs' : [ {
					orderable : false,
					targets : [ 0 ]
				} ],
				buttons : [ {
					text : '申请实验',
					action : function(e, dt, node, config) {
						$('#edit-modal').modal({})
					}
				} ]
			});
			$datatable.on('draw.dt', function() {
				$('input.flat').iCheck({
					checkboxClass : 'icheckbox_flat-green',
					radioClass : 'iradio_flat-green'
				});
			});
		});
	</script>



</body>
</html>